@extends('admin.layout.layout')
@section('content')
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">用户修改</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="panel-body">
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                    @if (count($errors) > 0)
                <div class="alert alert-danger">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
                <form action="{{url('/admin/user/update')}}" method="post" enctype="multipart/form-data">
                    <div class="form-group">
                        <label>用户名</label>
                        <input class="form-control" type="text" name="username" value="{{$user->username}}">
                    </div>
                <div class="form-group">
                    <label>头像上传</label>
                    <img src="{{ $user->pic }}" width="100px"  alt="">
                    <input type="file" name="pic">
                </div>



                    <div class="form-group">
                        <label>邮箱</label>
                        <input class="form-control" type="text" name="email" value="{{$user->email}}">
                    </div>
                    <div class="form-group">
                        <label>权限</label>
                        <div>
                        <select name="qx" style="width:470px;height:40px;margin-bottom:10px">
                            <option value="1"  <?php if($user->qx==1) echo 'selected'; ?> >超级管理员</option>
                            <option value="2" <?php if($user->qx==2) echo 'selected'; ?>>店主</option>
                            <option value="3" <?php if($user->qx==3) echo 'selected'; ?>>普通会员</option>
                        </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>手机号</label>
                        <input class="form-control" type="text" name="phone" value="{{$user->phone}}">
                    </div>
                    <input type="hidden" name="id" value="{{$user->id}}">
                        {{csrf_field()}}
                    <button type="submit" class="btn btn-primary btn-lg" style="margin-left:90px;width:100px">修改</button>
                    <button type="reset" class="btn btn-primary btn-lg" style="margin-left:100px;width:100px">重置</button>
                </form>
                </div>
            </div>
        </div>
   
@endsection